﻿@model GameCode.Models.Admin.DeviceReportModel
@{
    ViewBag.Title = "游戏特权 - 设备统计";
    Model.Caption = "设备统计";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript">
    function submitClick() {
        $("form").submit();
    }
    function exportClick() {
        $("#export").val("True");
        $("form").submit();
    }
     $(document).live('pageshow', function (event, ui) {
    $(".myDatePickerClass").datepicker({
        buttonImage: '@Url.Content("~/Content/image/calendar.gif")',               
        dateFormat: 'yy/mm/dd',                 
        showOn: 'button',               
        buttonImageOnly: true ,
        changeMonth:true,              
        changeYear:true,
    });   
}       
);
</script>
@using (Html.BeginForm(new { act = "submit" }))
{
    <div class="ui-bar ui-bar-a">
        条件
    </div>
    <div class="ui-body ui-body-a site-content-search">
        @Html.HiddenFor(m => m.IsExport, new { id = "export" })
        <div data-role="fieldcontain">
            <label for="Cycle" class="ui-input-text">
                周期：</label>
            @*@Html.LabelFor(m => m.Cycle)*@
            @Html.DropDownListFor(m => m.Cycle, new SelectList(Model.CycleList), new Dict() { "data-mini:true" })
        </div>
        <div data-role="fieldcontain">
            @Html.LabelFor(m => m.StartDate)
            @Html.TextBox("StartDate", Model.StartDate.ToString("d"), new { @class = "myDatePickerClass" })
        </div>
        <div data-role="fieldcontain">
            @Html.LabelFor(m => m.EndDate)
            @Html.TextBox("EndDate", Model.EndDate.ToString("d"), new { @class = "myDatePickerClass" })
        </div>
        <div>
            <input type="button" value="统计" data-inline="true" data-mini="true" onclick="submitClick()" />
            <input type="button" value="导出Excel" data-inline="true" data-mini="true" onclick="exportClick()" />
        </div>
    </div>
    if (Model.List != null)
    {
        var grid = new WebGrid(source: Model.List,canPage:false);
    @grid.GetHtml(
    htmlAttributes: new { cellpadding = "0", cellspacing = "0" },
        headerStyle: "ui-li ui-li-divider ui-btn ui-bar-a ui-btn-hover-undefined ui-btn-up-undefined",
    columns: grid.Columns
        (
            grid.Column("日期", "日期"),
            grid.Column("新增安卓机", "新增安卓机"),
            grid.Column("新增苹果机", "新增苹果机"),
            grid.Column("活跃安卓机", "活跃安卓机"),
            grid.Column("活跃苹果机", "活跃苹果机")
        )
    )
    }
}